import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import 'amfe-flexible'
import 'highlight.js/styles/default.css' // 代码高亮的样式
import './style/reset.css'// 引入初始化样式
import { NavBar, Form, Field, Button, Tab, Tag, Tabs, Tabbar, TabbarItem, Icon, Cell, Sticky, PullRefresh, List, Lazyload, ActionSheet, Popup, Row, Col, Badge, Search, Divider, CellGroup, Image, Dialog, DatetimePicker, Loading } from 'vant'
import directive from '@/utils/directives'// 导入自定义的全局指令
Vue.use(Tag)
Vue.use(Loading)

Vue.use(directive)// 注册插件，这样内部的instrall方法就会被执行了

Vue.use(Dialog)
Vue.use(DatetimePicker)
Vue.use(Divider)
Vue.use(CellGroup)
Vue.use(Image)

Vue.use(Badge)
Vue.use(Search)
Vue.use(Row)
Vue.use(Col)

Vue.use(Popup)

Vue.use(ActionSheet)
Vue.use(Lazyload)
Vue.use(List)
Vue.use(PullRefresh)
Vue.use(Sticky)
Vue.use(Cell)
Vue.use(Tab)
Vue.use(Tabs)
Vue.use(Icon)
Vue.use(NavBar)
Vue.use(Tabbar)
Vue.use(TabbarItem)
Vue.use(Button)
Vue.use(Form)
Vue.use(Field)
Vue.use(NavBar)
Vue.config.productionTip = false
// 技巧：把系统内置的log方法覆盖，让所有的打印失效
// 自动化-环境判断
// process.env node环境内置的-启动webpack+node打包/开发服务器时。会把.env.product/.env.devement文件里的变量赋值给process.env身上
if (process.env.NODE_ENV === 'production') {
  // 在生产环境
  console.log = function () {}
  console.error = function () {}
}

new Vue({

  router,
  store,
  render: h => h(App)
}).$mount('#app')
